package com.ruoyi.easywenku.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ruoyi.common.utils.LongValueSerializer;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 题目分类对象 awk_question_type
 *
 * @author yx
 * @date 2020-11-17
 */
@Data
public class QuestionType
{
    private static final long serialVersionUID = 1L;

    /** id */
    @TableId(type= IdType.ASSIGN_ID)
    @JsonSerialize(using = LongValueSerializer.class)
    private Long id;

    /** 代码 */
    @Excel(name = "代码")
    private String code;

    /** 父级id */
    @Excel(name = "父级id")
    private Long pId;

    /** 父级名称 */
    @Excel(name = "父级名称")
    private String pName;

    /** 名称 */
    @Excel(name = "名称")
    private String name;
    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setCode(String code)
    {
        this.code = code;
    }

    public String getCode()
    {
        return code;
    }
    public void setpId(Long pId)
    {
        this.pId = pId;
    }

    public Long getpId()
    {
        return pId;
    }
    public void setpName(String pName)
    {
        this.pName = pName;
    }

    public String getpName()
    {
        return pName;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("code", getCode())
            .append("pId", getpId())
            .append("pName", getpName())
            .append("name", getName())
            .toString();
    }
}
